﻿@model Telerik.Web.Mvc.GridModel<FixedTaxRateModel>
@using Telerik.Web.Mvc.UI;
@using SmartStore.Tax.Models;
@{
	Layout = "";
}

<div>
	@(Html.Telerik().Grid<FixedTaxRateModel>(Model.Data)
		.Name("Grid")
		.DataKeys(keys => keys.Add(x => x.TaxCategoryId).RouteKey("TaxCategoryId"))
		.Columns(columns =>
		{
			columns.Bound(x => x.TaxCategoryName)
				.Width("70%")
				.ReadOnly();
			columns.Bound(x => x.Rate)
				.Width("18%")
				.Format("{0:0.00}");
			columns.Command(commands =>
			{
				commands.Edit();
			}).Width("12%").HtmlAttributes(new { align = "right", @class = "omega" });
		})
		.DataBinding(dataBinding =>
		{
			dataBinding.Ajax()
				.Select("Configure", "TaxFixedRate", new RouteValueDictionary() { { "area", "SmartStore.Tax" } })
				.Update("TaxRateUpdate", "TaxFixedRate", new RouteValueDictionary() { { "area", "SmartStore.Tax" } });
		})
		.Editable(x => { x.Mode(GridEditMode.InLine); })
		.EnableCustomBinding(true))
</div>
